#include<iostream>
using namespace std;
int gcd(int a, int b)
{
	int t = 0;
	while (a) {
		t = b % a;
		b = a;
		a = t;
	}
	return b;
}
int main()
{
	int t;
	cin >> t;
	while (t--) {
		int n;
		cin >> n;
		int s = 1;	
		for (int i = 0; i < n; i++) {
			int m;
			cin >> m;
			s = s / gcd(s, m) * m ;
		}
		cout << s << endl;
	}
	return 0;
}